package com.godpaper.as9.commands
{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.godpaper.as9.bussiness.delegates.PhotoDelegate;
	import com.godpaper.as9.events.SetPhotoInfoEvent;
	import com.godpaper.as9.model.PhotoModelLocator;
	
	import mx.rpc.IResponder;

	public class SetPhotoInfoCommand extends CommandBase implements ICommand, IResponder
	{
		private var delegate:PhotoDelegate;
		private var photoModel:PhotoModelLocator = PhotoModelLocator.getInstance();
		private var setPhotoInfoEvent:SetPhotoInfoEvent;
		public function SetPhotoInfoCommand()
		{
			super();
			delegate = new PhotoDelegate(this);
		}
		
		override public function execute(event:CairngormEvent):void
		{
			setPhotoInfoEvent = SetPhotoInfoEvent(event);
			delegate.create(setPhotoInfoEvent.photoVO);
		}
		
		override public function result(data:Object):void
		{
			trace(data.result.detail+data.result.info);
		}
		
	}
}